using UnityEngine;
using System.Collections;

public class Loading : MonoBehaviour {
        
	public float amount;
    public string scene;
    public bool isReady;
    public TextMesh Ptext;
        
    void Start () 
    {
    	if(PlayerPrefs.HasKey("Scene"))
    	{
        	this.scene = PlayerPrefs.GetString("Scene");
     	}
               
       	isReady = true;         
	}
        
	void Update () 
	{
    	if(isReady)
    	{
        	amount = Application.GetStreamProgressForLevel(scene);
			Ptext.text = "Progress: " + amount;
			
			/*
        	if(transform.localScale.x >= 1)
        	{
            	isReady = false;
            	Application.LoadLevel(scene);
         	}*/
    	}
	}

}